#九九乘法表(靠左对齐右侧空白)
#用for...in...输出
 
for j in range(1,10):
	for i in range(1,j+1):
		print("{}*{}={:<4}".format(i,j,i*j),end=" ")
	print(" ")

for j in range(9,0,-1):
	for  i in range(1,j+1):
		print("{}*{}={:<4}".format(i,j,i*j),end=" ")
	print(" ")

#用wihile输出
j=1
while j<=9:
	i=1
	while i<=j:
		print("%d*%d=%d\t"%(i,j,i*j),end=" ")
		i+=1
	print(' ')
	j+=1

j=9
while j>=1:
	i=1
	while i<=j:
		print("%d*%d=%d\t"%(i,j,i*j),end=" ")
		i+=1
	print(' ')
	j-=1

#九九乘法表(靠右对齐左侧空白正三角)
#用for...in...输出
for j in range(1,10):
	for k in range(1,10-j):
		print(end="       ")
	for i in range(1,j+1):
		print("{}*{}={:>2}".format(i,j,i*j),end=" ")

	print(" ")

#九九乘法表(靠右对齐左侧空白倒三角)
for j in range(9,0,-1):
	for k in range(1,10-j):
		print(end="       ")
	for i in range(1,j+1):
		print("{}*{}={:>2}".format(i,j,i*j),end=" ")
	print(" ")

#用while输出
j=1
while j<=9:
	k=1
	while k<=9-j:
		print(end="       ")
		k+=1
	i=1
	while i<j+1:
		print("{}*{}={:>2}".format(i,j,i*j),end=" ")
		i+=1
	print(" ")
	j+=1

j=9
while j>=0:
	k=1
	while k<=9-j:
		print(end="       ")
		k+=1
	i=1
	while i<j+1:
		print("{}*{}={:>2}".format(i,j,i*j),end=" ")
		i+=1
	print(" ")
	j-=1